﻿<UserControl x:Class="ColorChooserX2.Views.Components.SpectrumSlider"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:conv="clr-namespace:ColorChooserX2.Views.Converter"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="30">
    <Grid Background="Transparent" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" SizeChanged="Grid_SizeChanged" PreviewMouseMove="Rectangle_MouseMove" PreviewMouseDown="Rectangle_MouseDown">
        <Grid.Resources>
            <conv:PointToMarginConverter x:Key="PointToMarginConverter" />
        </Grid.Resources>
        <Border Margin="4,10,4,10">
            <Grid>
            <Rectangle Name="bar" Width="20" Fill="{Binding BarBrush}" />
            <Rectangle Name="bar2" Width="20" Fill="{Binding Bar2Brush}" />
            </Grid>
        </Border>
        <Polygon StrokeThickness="1" Points="0,0 0,12 6,6" HorizontalAlignment="Left" Margin="{Binding CrosshairPosition, Converter={StaticResource PointToMarginConverter},ConverterParameter=4, Mode=TwoWay}" />
        <Polygon StrokeThickness="1" Points="0,6 6,0 6,12" HorizontalAlignment="Right"  Margin="{Binding CrosshairPosition, Converter={StaticResource PointToMarginConverter},ConverterParameter=4,Mode=TwoWay}" />
    </Grid> 
    
</UserControl>
